import React from 'react';

export default class Password extends React.Component {
  static propTypes = {
    value: React.PropTypes.string,
  };

  state = {
  	value: ''
  };

  constructor(props) {
    super(props);
  }

  handleInput = (event) => {
  	let { value } = event.target;
  	this.setState({ value }, () => {
  		var charCode = value.charCodeAt(value.length - 1);
  		if (charCode >= 65 && charCode <= 90) {
  			// dispatch
  		}
  	});
  };

  render() {
  	let { value } = this.state;

    return (
      <input type='password' value={value} onInput={this.handleInput} />
    );
  }
}
